package jman.competition14;

import java.sql.ResultSet;
import java.sql.SQLException;

public class UserDao {
	public User getUserByUserName(String userName) throws SQLException{
		Dao d=new Dao();
		d.start();
		String sql="select * from user where username='"+userName+"'";
		String password="";
		ResultSet rs=d.read(sql);
		while(rs.next()){
			password=rs.getString("password");
		}
		User u=new User(userName,password);
		d.close();
		return u;
	}
}
